<template>
  <div class="new-config">
    <div class="new-config__container">
      <sidebar class="new-config__container--left"></sidebar>
      <div class="new-config__container--right" :class="navMenuState ? 'navMenuState' : ''">
        <keep-alive>
          <router-view class=""/>
        </keep-alive>
      </div>
    </div>
  </div>
</template>
<script>
  import sidebar from './base/sideBar.vue'
  export default {
    name: 'newConfig',
    data () {
      return {
        currentRoute: '',
        visib: true,
        title: '添加外显号组'
      }
    },
    components: {
      sidebar
    },
    computed: {
      navMenuState () {
        return this.$store.state.navMenuState
      }
    },
    beforeMount () {
    },
    beforeRouteLeave (to, from, next) {
      this.currentRoute = from.fullPath
      next()
    },
    beforeRouteEnter (to, from, next) {
      next(vm => {
        if (to.query.active) {
          vm.$router.push({path: to.path + '/' + to.query.active})
        } else if (vm.currentRoute) {
          vm.$router.push({path: vm.currentRoute})
        }
      })
    },
    watch: {
      '$route' (to, from) {
        console.log(to)
        console.log(from)
      }
    }
  }
</script>
<style lang="stylus">
  .new-config
    height: 100vh
    background-color #e4e4e4
    .new-config__container
      height: calc(100vh - 52px)
      position: relative
      background-color: #fff
      .new-config__container--left
        background-color: #f0f2f3;
        width: 188px;
        height: calc(100vh - 52px);
        border-right: 1px solid #d7d7d7;
        float: left;
      .new-config__container--right
        margin-left 188px
        height: calc(100vh - 52px)
        .addOrEditCallServiceSkillGroup
          .form_box
           overflow-y  visible
          .btn_box
            padding-bottom 30px
        .blacklist-wrap>.tip,.addOrEditCallServiceSkillGroup>.tab
          display block
        .dept-agent-config
          width auto
          height: calc(100vh - 52px)
          .dept-tree
            height: calc(100vh - 93px)
        .call-label
          height: calc(100vh - 52px)
        .safety
          height calc(100vh - 75px)
        .black-red
          clear none
          overflow-y auto
          .card-group
            height: calc(100vh - 54px)
          .detail
            height: calc(100vh - 92px)
        .callSkill,.internetChannelSkillWrap,.webchatApp
          overflow-y auto
          .card-group,.detail
            height: calc(100vh - 50px)!important
          .form_box
            max-height: calc(100vh)!important
        .addImChannelSkillGroup
          max-height calc(100vh - 100px)
        .addInternetChannelSkillGroup
           max-height: calc(100vh - 128px)
           max-height calc(100vh - 100px)
           .primary_btn
             margin-bottom 20px
        .addImChannelSkillGroup
          max-height: calc(100vh - 90px)
        .satisfaction
          overflow-y auto
          .wrapper
            .card-group
               height: calc(100vh - 92px) !important
            .detail
               height: calc(100vh - 92px) !important
</style>
